mochafictionfandomcom-20200214-history
Help:Pipe trick
The pipe trick uses the pipe character ("|'") to save typing-in the right hand side of a for several kinds of wikilinks. This can reduce typos in these links. When the last character of a link is the pipe character, ''the pipe trick will automatically generate the text that displays for that link. This is done when the page is saved. It removes the parenthesized part of the link title, but it also processes commas in the title and Namespace prefixes. It does '''not have effects on the number sign ("#") (used to link directly to an article section). The pipe trick does not work in edit summaries, or within tags. Examples This technique may be hard to follow, so please see the following examples: Combinations The basic rule when the pipe trick is used, is that an (initial) namespace prefix, a final part beginning with a comma, or a final parenthesis (usually intended for disambiguation) is suppressed in the rendering of the link. The rendered text is case neutral and so should be entered precisely as the user wishes it to appear in the article. In case of combinations of suppressible parts, the following rules apply: Parentheses beat commas If the link name involves both one or more commas and a final parenthesis, only the parenthesis is suppressed: Yours, Mine and Ours (1968 film) is shown on the page as: :Yours, Mine and Ours Only one prefix suppressed If there are several prefixes, which can occur, for example, for an , only the first is suppressed: es:Wikipedia:Políticas is rendered as: :Wikipedia:Políticas The first comma counts If there are several commas, only the part up to the first comma is shown: Il Buono, il Brutto, il Cattivo results in: :Il Buono Other combinations For the rest, if there is both an initial part and a final part that can be omitted, both are suppressed: Wikipedia:Manual of Style (Persian) produces: :Manual of Style Where it does not work Cite.php footnotes :This limitation has been removed in the development version of the software, and so the following will not be broken in the future. However, it does not yet work, . The trick does not work when enclosing between "ref" tags. renders in the references list (generated by the tag) as: Edit summaries The trick does not work in edit summaries. /* Edit summaries and the pipe trick */ as tested in WP:SAND renders in the edit history as: (→Edit summaries and the pipe trick: as tested in WP:SAND) Section links :Currently: The pipe trick does not work on , and in general it does not work for links to anchors (links that use a # sign). For example, Wikipedia:Verifiability#Sources does not give you a clickable wikilink "Verifiability#Sources" but results in: :Wikipedia:Verifiability#Sources :Future behaviour, not valid : The pipe trick works only for section links to the current page. While Examples gives Examples; Other#Examples acts like Other#Examples Slash trick You can achieve the same effect for subpages by adding a slash: /subpage/ generates the same output as subpage. Unlike the pipe trick, though, it will not be transformed in the wikitext. This trick only works in namespaces where /subpage would. Reverse pipe trick If the title of the article containing the link includes a parenthesized term or a comma, placing a pipe at the start of the link will append the corresponding text. For example, if the link [[|Agonizer]] were placed in Agonist (disambiguation), the link would be expanded to [[Agonizer (disambiguation)|Agonizer]]. Using the reverse pipe trick on an article that has no parentheses or comma in its title is unproductive; the pipe character is automatically removed. The reverse pipe trick does not work with colons. Try it! The best way to understand this when editing a page, is to try it yourself with the "Show Preview" or "Show Changes" buttons; or you can try it in the sandbox: use one of the examples under "Type this" above, save the sandbox page, then immediately edit it again. You'll see the transformation, and it might be more clear exactly what happened.